<?php ?>

<div id="example" class="k-content">
    <div id="grid"></div>
    <script>
        $(document).ready(function () {
            dataSource = new kendo.data.DataSource({
                transport: {
                    read:{
                        url: "<?php echo $this->Html->Url(array('controller' => 'ordenes', 'action' => 'consultaOrdenes')); ?>",
                        dataType: "json"
                    },
                    parameterMap: function(options, operation) {
                        if (operation !== "read" && options.models) {
                            return {models: kendo.stringify(options.models)};
                        }
                    }
                },
                batch: true,
                pageSize: 20,
            });
                
            $("#grid").kendoGrid({
                dataSource: dataSource,
                pageable: true,
                height: 430,
                columns: [
                    { field: "folio", title:"Folio", width: "100px" },
                    { field: "descripcion", title:"Descripcion", width: "100px" },
                    { field: "observaciones", title:"Observaciones", width: "100px" },
                    { field: "estado", title:"Estado", width: "100px" },
                    { field: "fecha", title:"Fecha", width: "100px" },
                    { field: "id_asesor", title:"Asesor", width: "100px" },
                    { field: "id_cliente", title:"Cliente", width: "100px" },
                    { field: "id_ing", title:"Ingeniero", width: "100px" }]
            });
        });
    </script>
</div>